package com.zito.health.controller;

import com.zito.health.common.annotations.ResponseResult;
import com.zito.health.common.result.PlatformResult;
import com.zito.health.common.result.VerifyResult;
import com.zito.health.common.util.StringUtil;
import com.zito.health.entity.ItemFeasibility;
import com.zito.health.entity.ItemUndertake;
import com.zito.health.service.ItemFeasibilityService;
import com.zito.health.service.ItemUndertakeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 项目可行性报告表
 */
@Slf4j
@RestController
@RequestMapping("/item/feasibility")
public class ItemFeasibilityController {

    @Autowired
    private ItemFeasibilityService itemFeasibilityService;

    @PostMapping("/save")
    public PlatformResult save(ItemFeasibility item){
        if(item.getId() == null){
            itemFeasibilityService.save(item);
        }else{
            itemFeasibilityService.update(item);
        }
        return  PlatformResult.success();
    }

    @PostMapping("/update")
    public PlatformResult update(ItemFeasibility item){
        itemFeasibilityService.update(item);
        return  PlatformResult.success();
    }

    @PostMapping("/query")
    public PlatformResult query(ItemFeasibility item){
        return PlatformResult.success(itemFeasibilityService.query(item));
    }

}
